In [1]:
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import plotly


/home/mldantas/miniconda2/lib/python2.7/site-packages/matplotlib/font_manager.py:273: UserWarning: Matplotlib is building the font cache using fc-list. This may take a moment.
  warnings.warn('Matplotlib is building the font cache using fc-list. This may take a moment.')

In [2]:
my_data = np.loadtxt('myGAMA_ALL_AB_ABSOL_MAGS.csv', delimiter=',', dtype=str)

In [3]:
my_dictionary = {}
for i in range(len(my_data[0, :])):                                         # Converting numpy array into dictionary
    my_dictionary[my_data[0, i]] = np.array(my_data[0 + 1:, i], dtype=str)

In [4]:
print my_dictionary


{'MAGERR_PETRO_Z': array(['0.06512446', '0.5344014', '0.1702001', ..., '0.4302158',
       '0.1092938', '0.06709368'], 
      dtype='|S114'), 'MAGERR_PETRO_Y': array(['0.08165', '0.1127', '0.11845', ..., '0.31855', '0.139725',
       '0.04945'], 
      dtype='|S114'), 'MAG_ABSOLUTE_H': array(['-22.8580026674', '-22.1141026674', '-22.2197026674', ...,
       '-21.3751026674', '-22.5776026674', '-22.7027026674'], 
      dtype='|S114'), 'MAG_ABSOLUTE_I': array(['-23.0974161773', '-21.9876761773', '-22.1160361773', ...,
       '-22.2427961773', '-22.3053461773', '-23.1538261773'], 
      dtype='|S114'), 'MAG_ABSOLUTE_J': array(['-20.7667690337', '-20.2087690337', '-20.9676690337', ...,
       '-20.1757690337', '-20.9463690337', '-21.1419690337'], 
      dtype='|S114'), 'MAGERR_PETRO_U': array(['0.115243', '0.4083196', '0.7177367', ..., '0.2589939', '0.3321692',
       '0.1729058'], 
      dtype='|S114'), 'MAGERR_PETRO_R': array(['0.01883182', '0.05261943', '0.07991493', ..., '0.07228862',
       '0.03431689', '0.01822866'], 
      dtype='|S114'), 'MAG_ABSOLUTE_R': array(['-18.9625618162', '-17.7949318162', '-17.6855518162', ...,
       '-18.1644818162', '-18.1408418162', '-18.8356918162'], 
      dtype='|S114'), 'MAGERR_PETRO_J': array(['0.186875', '0.1449', '0.198375', ..., '0.26335', '0.1012',
       '0.086825'], 
      dtype='|S114'), 'MAGERR_PETRO_K': array(['0.1288', '0.14375', '0.1633', ..., '569.25', '0.17825', '0.0736'], 
      dtype='|S114'), 'MAGERR_PETRO_H': array(['0.116725', '0.1127', '0.2116', ..., '0.297275', '0.10235',
       '0.107525'], 
      dtype='|S114'), 'MAGERR_PETRO_I': array(['0.01971233', '0.07497911', '0.08628478', ..., '0.1075859',
       '0.03985928', '0.02098087'], 
      dtype='|S114'), 'MAGERR_PETRO_G': array(['0.02253138', '0.06135861', '0.1493604', ..., '0.07418481',
       '0.0491937', '0.02253138'], 
      dtype='|S114'), 'MAG_ABSOLUTE_Z': array(['-21.369545879', '-20.164855879', '-20.542705879', ...,
       '-20.384025879', '-20.637345879', '-21.389695879'], 
      dtype='|S114'), 'NUVFLAG': array(['0', '0', '1', ..., '0', '0', '-999'], 
      dtype='|S114'), 'R_MODEL_ERR': array(['0.01269163', '0.02095801', '0.02882093', ..., '0.02977652',
       '0.02012614', '0.01120032'], 
      dtype='|S114'), 'I_MODEL': array(['17.79754', '18.90728', '18.77892', ..., '18.65216', '18.58961',
       '17.74113'], 
      dtype='|S114'), 'SPLIT_MAGERR_FUV': array(['0.115696', '0.229221', '0.600451', ..., '0.0635147', '0.243523',
       '-999.0'], 
      dtype='|S114'), 'MAG_ABSOLUTE_G': array(['-22.798476775', '-21.756226775', '-20.626976775', ...,
       '-22.264966775', '-21.856876775', '-22.685376775'], 
      dtype='|S114'), 'I_MODEL_ERR': array(['0.01554478', '0.02614872', '0.024629', ..., '0.03788096',
       '0.02267132', '0.01151163'], 
      dtype='|S114'), 'RA': array(['221.8451', '219.3092', '222.7029', ..., '217.3131', '223.1262',
       '132.4369'], 
      dtype='|S114'), 'Z_MODEL': array(['17.58029', '18.78498', '18.40713', ..., '18.56581', '18.31249',
       '17.56014'], 
      dtype='|S114'), 'Column2': array(['493643', '493088', '506023', ..., '320243', '299075', '301159'], 
      dtype='|S114'), 'KRON_RADIUS': array(['3.5', '3.5', '3.5', ..., '3.5', '3.72', '3.5'], 
      dtype='|S114'), 'SPLIT_MAGERR_NUV': array(['0.0570107', '0.11068', '0.255222', ..., '0.0618877', '0.120901',
       '-999.0'], 
      dtype='|S114'), 'MAG_ABSOLUTE_K': array(['-20.0221039351', '-19.2813039351', '-19.8307039351', ...,
       '61.4993960649', '-19.2828039351', '-20.4209039351'], 
      dtype='|S114'), 'MAG_ABSOLUTE_Y': array(['-22.3407340444', '-21.2461340444', '-22.1110340444', ...,
       '-20.7995340444', '-21.6368340444', '-22.4834340444'], 
      dtype='|S114'), 'URL': array([ 'http://www.gama-survey.org/dr2/data/imaging/gama/SersicPhotometry/v07/S00100842/',
       'http://www.gama-survey.org/dr2/data/imaging/gama/SersicPhotometry/v07/S00100329/',
       'http://www.gama-survey.org/dr2/data/imaging/gama/SersicPhotometry/v07/S00102501/',
       ...,
       'http://www.gama-survey.org/dr2/data/imaging/gama/SersicPhotometry/v07/S00072877/',
       'http://www.gama-survey.org/dr2/data/imaging/gama/SersicPhotometry/v07/S00068602/',
       'http://www.gama-survey.org/dr2/data/imaging/gama/SersicPhotometry/v07/S00069500/'], 
      dtype='|S114'), 'FLUXERR_AUTO_U': array(['201.8924', '162.8104', '191.9753', ..., '230.9364', '157.3138',
       '152.9126'], 
      dtype='|S114'), 'KCORR_R_k1': array(['0.07319286', '0.07130702', '0.4574272', ..., '-0.004517556',
       '0.09181257', '0.1478551'], 
      dtype='|S114'), 'KCORR_FUV_k1': array(['0.4316946', '-0.05040442', '-0.09429342', ..., '0.07210641',
       '0.3832984', '-0.1253016'], 
      dtype='|S114'), 'KCORR_FUV_k0': array(['0.4316946', '-0.05040442', '-0.09429342', ..., '0.07210641',
       '0.3832984', '-0.1253016'], 
      dtype='|S114'), 'KCORR_Y_k1': array(['-0.01122948', '-0.02368502', '0.1926859', ..., '-0.1355442',
       '0.02734818', '0.07121805'], 
      dtype='|S114'), 'BEST_MAG_NUV': array(['20.46078', '21.65598', '22.89509', ..., '21.06731', '22.23861',
       '21.8115'], 
      dtype='|S114'), 'MAG_ABSOLUTE_FUV': array(['-17.949242616', '-16.698202616', '-15.298652616', ...,
       '-17.842622616', '-16.045012616', '-16.793282616'], 
      dtype='|S114'), 'Z_HELIO': array(['0.1435', '0.16939', '0.36226', ..., '0.143', '0.14186', '0.12919'], 
      dtype='|S114'), 'METS_k0': array(['0.02012975', '0.02566784', '0.02621207', ..., '0.01462944',
       '0.02062655', '0.03178594'], 
      dtype='|S114'), 'METS_k1': array(['0.02012975', '0.02566784', '0.02621207', ..., '0.01462944',
       '0.02062655', '0.03178594'], 
      dtype='|S114'), 'OBJID_SDSSDR7': array(['587729778521276442', '587729778520162658', '587729971252429276',
       ..., '587726032264888724', '587726031730573811',
       '587726032227729692'], 
      dtype='|S114'), 'KCORR_G_k0': array(['0.2147868', '0.1988727', '1.244765', ..., '0.08588859',
       '0.2687564', '0.2144241'], 
      dtype='|S114'), 'TOT_MAGERR_NUV': array(['0.0529366', '0.11068', '0.255222', ..., '0.0618877', '0.120901',
       '-999.0'], 
      dtype='|S114'), 'UV_CLASS_YI2011': array(['RSF', 'RSF', 'RSF', ..., 'RSF', 'RSF', 'RSF'], 
      dtype='|S114'), 'R_MODEL': array(['18.02382', '19.19145', '19.30083', ..., '18.8219', '18.84554',
       '18.15069'], 
      dtype='|S114'), 'KCORR_G_k1': array(['0.2147868', '0.1988727', '1.244765', ..., '0.08588859',
       '0.2687564', '0.2144241'], 
      dtype='|S114'), 'MAG_ABSOLUTE_NUV': array(['-19.0951220349', '-17.8999220349', '-16.6608120349', ...,
       '-18.4885920349', '-17.3172920349', '-17.7444020349'], 
      dtype='|S114'), 'MAG_ABSOLUTE_U': array(['-21.6095357086', '-20.7808557086', '-19.7127957086', ...,
       '-21.4513057086', '-20.5684657086', '-21.5311057086'], 
      dtype='|S114'), 'TOT_MAG_FUV': array(['21.0466', '22.4627', '23.8622', ..., '21.3183', '23.1159', '-999.0'], 
      dtype='|S114'), 'A_NUV': array(['0.44491', '0.3932', '0.54261', ..., '0.29585', '0.38269', '0.34628'], 
      dtype='|S114'), 'KCORR_K_k1': array(['-0.3205533', '-0.3522369', '-0.504846', ..., '-0.3395413',
       '-0.3079026', '-0.2359686'], 
      dtype='|S114'), 'MAGERR_AUTO_Y': array(['0.071875', '0.082225', '0.16445', ..., '0.175375', '0.09315',
       '0.0414'], 
      dtype='|S114'), 'MAGERR_AUTO_Z': array(['0.06255199', '0.1862522', '0.1215944', ..., '0.3695144',
       '0.08897707', '0.05243083'], 
      dtype='|S114'), 'NN_NMATCH4': array(['1', '1', '1', ..., '1', '1', '-999'], 
      dtype='|S114'), 'MAGERR_AUTO_U': array(['0.1059555', '0.2068342', '0.5821884', ..., '0.2007858',
       '0.2491849', '0.1294756'], 
      dtype='|S114'), 'KCORR_NUV_k1': array(['0.216782', '0.005155872', '0.09911565', ..., '0.09999306',
       '0.2302435', '-0.0567688'], 
      dtype='|S114'), 'KCORR_NUV_k0': array(['0.216782', '0.005155872', '0.09911565', ..., '0.09999306',
       '0.2302435', '-0.0567688'], 
      dtype='|S114'), 'MAGERR_AUTO_R': array(['0.0175222', '0.03729674', '0.05030662', ..., '0.04965449',
       '0.02634081', '0.0150862'], 
      dtype='|S114'), 'GAL_ELLIP_R': array(['0.4439', '0.5982', '0.3343', ..., '0.161', '0.3337', '0.0967'], 
      dtype='|S114'), 'MAG_PETRO_H': array(['17.3115', '18.0554', '17.9498', ..., '18.7944', '17.5919',
       '17.4668'], 
      dtype='|S114'), 'MAGERR_AUTO_I': array(['0.0187077', '0.04935297', '0.05340527', ..., '0.0730368',
       '0.0305442', '0.01679181'], 
      dtype='|S114'), 'MAGERR_AUTO_J': array(['0.142025', '0.10005', '0.139725', ..., '0.209875', '0.081075',
       '0.0598'], 
      dtype='|S114'), 'MAG_PETRO_K': array(['17.4785', '18.2193', '17.6699', ..., '99.0', '18.2178', '17.0797'], 
      dtype='|S114'), 'MAGERR_AUTO_G': array(['0.0203948', '0.04091427', '0.1236756', ..., '0.05129496',
       '0.03574108', '0.01851691'], 
      dtype='|S114'), 'KCORR_K_k0': array(['-0.3205533', '-0.3522369', '-0.504846', ..., '-0.3395413',
       '-0.3079026', '-0.2359686'], 
      dtype='|S114'), 'FILENAME': array(['/GAMA/dr2/data/imaging/gama/SersicPhotometry/v07/S00100842/',
       '/GAMA/dr2/data/imaging/gama/SersicPhotometry/v07/S00100329/',
       '/GAMA/dr2/data/imaging/gama/SersicPhotometry/v07/S00102501/', ...,
       '/GAMA/dr2/data/imaging/gama/SersicPhotometry/v07/S00072877/',
       '/GAMA/dr2/data/imaging/gama/SersicPhotometry/v07/S00068602/',
       '/GAMA/dr2/data/imaging/gama/SersicPhotometry/v07/S00069500/'], 
      dtype='|S114'), 'GAL_CHI2_R': array(['6.067', '0.987', '1.025', ..., '1.025', '0.96', '1.03'], 
      dtype='|S114'), 'FLUX_AUTO_U': array(['12568.97', '5184.136', '2168.406', ..., '7572.974', '4157.181',
       '7807.473'], 
      dtype='|S114'), 'KCORR_U_k0': array(['0.2051812', '0.1834948', '1.230798', ..., '0.08293451',
       '0.2205468', '0.2274951'], 
      dtype='|S114'), 'COG_MAG_NUV': array(['-999.0', '-999.0', '22.7697', ..., '21.0528', '22.2516', '21.8115'], 
      dtype='|S114'), 'MAG_AB_J': array(['19.6009376071', '20.1502674997', '19.2551847741', ...,
       '20.238633542', '19.4118916248', '19.1394313512'], 
      dtype='|S114'), 'KCORR_I_k0': array(['-0.0309916', '-0.1107947', '0.2654688', ..., '-0.107921',
       '0.02357995', '-0.02888804'], 
      dtype='|S114'), 'NMATCHUV': array(['1', '1', '1', ..., '1', '1', '-999'], 
      dtype='|S114'), 'A_Y': array(['0.06164', '0.05447', '0.07517', ..., '0.04099', '0.05302',
       '0.04797'], 
      dtype='|S114'), 'A_B': array(['0.21531', '0.19028', '0.26258', ..., '0.14317', '0.18519',
       '0.16757'], 
      dtype='|S114'), 'SPECID_BEST': array(['G15_Y2_004_244', 'G15_Y2_016_379', 'G15_Y1_GX2_086', ...,
       'G15_Y3_001_214', 'G15_Y1_IN1_385', 'G09_Y1_CN1_020'], 
      dtype='|S114'), 'A_K': array(['0.01832', '0.01619', '0.02235', ..., '0.01218', '0.01576',
       '0.01426'], 
      dtype='|S114'), 'A_J': array(['0.04525', '0.03999', '0.05519', ..., '0.03009', '0.03892',
       '0.03522'], 
      dtype='|S114'), 'A_H': array(['0.02942', '0.026', '0.03588', ..., '0.01956', '0.02531', '0.0229'], 
      dtype='|S114'), 'A_u': array(['0.26239', '0.23189', '0.32', ..., '0.17447', '0.22569', '0.20422'], 
      dtype='|S114'), 'DEC': array(['-1.228581', '-1.302377', '-1.965155', ..., '1.706166', '1.24124',
       '1.165748'], 
      dtype='|S114'), 'A_r': array(['0.14002', '0.12375', '0.17077', ..., '0.09311', '0.12044',
       '0.10898'], 
      dtype='|S114'), 'FUVFLAG': array(['0', '0', '0', ..., '0', '256', '-999'], 
      dtype='|S114'), 'Z_MODEL_ERR': array(['0.0421836', '0.0754646', '0.07778312', ..., '0.1371088',
       '0.06132298', '0.03724301'], 
      dtype='|S114'), 'TOT_MAG_NUV': array(['20.2957', '21.656', '22.8951', ..., '21.0673', '22.2386', '-999.0'], 
      dtype='|S114'), 'KCORR_U_k1': array(['0.2051812', '0.1834948', '1.230798', ..., '0.08293451',
       '0.2205468', '0.2274951'], 
      dtype='|S114'), 'A_z': array(['0.07528', '0.06653', '0.09181', ..., '0.05006', '0.06475',
       '0.05859'], 
      dtype='|S114'), 'A_g': array(['0.19306', '0.17062', '0.23546', ..., '0.12838', '0.16606',
       '0.15026'], 
      dtype='|S114'), 'A_FUV': array(['0.42633', '0.37678', '0.51995', ..., '0.28349', '0.36671',
       '0.33182'], 
      dtype='|S114'), 'A_i': array(['0.10618', '0.09384', '0.12949', ..., '0.0706', '0.09133', '0.08264'], 
      dtype='|S114'), 'TOT_MAGERR_FUV': array(['0.806099', '0.921783', '1.25454', ..., '0.301664', '0.992596',
       '-999.0'], 
      dtype='|S114'), 'MAG_AB_Y': array(['18.6757377089', '19.785413841', '18.6965733054', ...,
       '20.3487999111', '19.3442118421', '18.4555834692'], 
      dtype='|S114'), 'MAG_AB_Z': array(['18.0056705022', '19.2123488176', '18.6277690586', ...,
       '19.0834505949', '18.7169874291', '17.9041061883'], 
      dtype='|S114'), 'MAG_AB_U': array(['19.8760840503', '20.7379071924', '20.7255710382', ...,
       '20.1895569315', '20.9155675049', '19.9540298885'], 
      dtype='|S114'), 'MAG_AB_R': array(['18.3060414935', '19.4816664077', '19.1872800843', ...,
       '19.1994264561', '19.1164891836', '18.3698895166'], 
      dtype='|S114'), 'KCORR_H_k1': array(['-0.04575376', '-0.04058086', '-0.03072675', ..., '-0.1180318',
       '-0.02869546', '0.03848036'], 
      dtype='|S114'), 'MAG_AB_H': array(['19.1236091042', '19.8635672693', '19.7445572111', ...,
       '20.6823326949', '19.3884314095', '19.1970206623'], 
      dtype='|S114'), 'MAG_AB_I': array(['18.1975449791', '19.3916154985', '18.8739144864', ...,
       '19.1421336529', '18.9404885686', '18.1476579885'], 
      dtype='|S114'), 'BEST_MAGERR_NUV': array(['0.05701065', '0.1106796', '0.2552223', ..., '0.06188774',
       '0.1209011', '0.07970843'], 
      dtype='|S114'), 'MAG_AB_K': array(['20.090102131', '20.8633872196', '20.4642812088', ...,
       '101.632898472', '20.8177153835', '19.6082445918'], 
      dtype='|S114'), 'MAG_AB_G': array(['18.7701043705', '19.8372064886', '19.8947466025', ...,
       '19.4582546766', '19.6684845491', '18.9005976185'], 
      dtype='|S114'), 'MAG_PETRO_Y': array(['17.6551', '18.7497', '17.8848', ..., '19.1963', '18.359', '17.5124'], 
      dtype='|S114'), 'SPLIT_MAG_FUV': array(['21.2116', '22.4627', '23.8622', ..., '21.3183', '23.1159', '-999.0'], 
      dtype='|S114'), 'MAG_PETRO_Z': array(['17.5436', '19.8279', '18.3662', ..., '19.1892', '18.2268', '17.623'], 
      dtype='|S114'), 'KCORR_H_k0': array(['-0.04575376', '-0.04058086', '-0.03072675', ..., '-0.1180318',
       '-0.02869546', '0.03848036'], 
      dtype='|S114'), 'URL_R': array([ 'http://www.gama-survey.org/dr2/data/imaging/gama/SersicPhotometry/v07/S00100842/prfplot_sdss_r_g15_S00100842.png',
       'http://www.gama-survey.org/dr2/data/imaging/gama/SersicPhotometry/v07/S00100329/prfplot_sdss_r_g15_S00100329.png',
       'http://www.gama-survey.org/dr2/data/imaging/gama/SersicPhotometry/v07/S00102501/prfplot_sdss_r_g15_S00102501.png',
       ...,
       'http://www.gama-survey.org/dr2/data/imaging/gama/SersicPhotometry/v07/S00072877/prfplot_sdss_r_g15_S00072877.png',
       'http://www.gama-survey.org/dr2/data/imaging/gama/SersicPhotometry/v07/S00068602/prfplot_sdss_r_g15_S00068602.png',
       'http://www.gama-survey.org/dr2/data/imaging/gama/SersicPhotometry/v07/S00069500/prfplot_sdss_r_g09_S00069500.png'], 
      dtype='|S114'), 'CATAID': array(['493643', '493088', '506023', ..., '320243', '299075', '301159'], 
      dtype='|S114'), 'COG_MAGERR_NUV': array(['-999.0', '-999.0', '0.196705', ..., '0.0651389', '0.112352',
       '0.0797084'], 
      dtype='|S114'), 'URL_K': array([ 'http://www.gama-survey.org/dr2/data/imaging/gama/SersicPhotometry/v07/S00100842/prfplot_ukidss_K_g15_S00100842.png',
       'http://www.gama-survey.org/dr2/data/imaging/gama/SersicPhotometry/v07/S00100329/prfplot_ukidss_K_g15_S00100329.png',
       'http://www.gama-survey.org/dr2/data/imaging/gama/SersicPhotometry/v07/S00102501/prfplot_ukidss_K_g15_S00102501.png',
       ...,
       'http://www.gama-survey.org/dr2/data/imaging/gama/SersicPhotometry/v07/S00072877/prfplot_ukidss_K_g15_S00072877.png',
       'http://www.gama-survey.org/dr2/data/imaging/gama/SersicPhotometry/v07/S00068602/prfplot_ukidss_K_g15_S00068602.png',
       'http://www.gama-survey.org/dr2/data/imaging/gama/SersicPhotometry/v07/S00069500/prfplot_ukidss_K_g09_S00069500.png'], 
      dtype='|S114'), 'KCORR_R_k0': array(['0.07319286', '0.07130702', '0.4574272', ..., '-0.004517556',
       '0.09181257', '0.1478551'], 
      dtype='|S114'), 'MAG_PETRO_U': array(['19.7325', '21.0371', '21.3378', ..., '20.1621', '20.9187',
       '20.3151'], 
      dtype='|S114'), 'GAL_QFLAG_R': array(['1026', '0', '0', ..., '0', '0', '0'], 
      dtype='|S114'), 'MAG_AB_FUV': array(['21.0161813527', '22.7681276028', '24.1572416645', ...,
       '21.5365556361', '22.9914270591', '22.7649729506'], 
      dtype='|S114'), 'NN_DIST': array(['0.9219597', '1.013598', '2.534365', ..., '0.2686404', '0.7129018',
       '-999.0'], 
      dtype='|S114'), 'PETRO_RADIUS': array(['3.96', '5.28', '5.94', ..., '5.28', '5.28', '4.62'], 
      dtype='|S114'), 'MAG_PETRO_R': array(['18.0981', '19.3001', '19.6508', ..., '19.301', '18.9348', '18.1438'], 
      dtype='|S114'), 'Column4': array(['493643', '493088', '506023', ..., '320243', '299075', '301159'], 
      dtype='|S114'), 'Column1': array(['493643', '493088', '506023', ..., '320243', '299075', '301159'], 
      dtype='|S114'), 'Column3': array(['493643', '493088', '506023', ..., '320243', '299075', '301159'], 
      dtype='|S114'), 'MAG_AUTO_G': array(['18.6555', '19.8444', '20.9829', ..., '19.7357', '19.7824',
       '18.9105'], 
      dtype='|S114'), 'MASS_k1': array(['10371080000.0', '3301620000.0', '64605800000.0', ...,
       '1824557000.0', '6507672000.0', '9136853000.0'], 
      dtype='|S114'), 'MASS_k0': array(['10371080000.0', '3301620000.0', '64605800000.0', ...,
       '1824557000.0', '6507672000.0', '9136853000.0'], 
      dtype='|S114'), 'U_MODEL_ERR': array(['0.1033679', '0.1404033', '0.5234814', ..., '0.1558086',
       '0.2511652', '0.08283377'], 
      dtype='|S114'), 'G_MODEL': array(['18.6538', '19.69605', '20.8253', ..., '19.18731', '19.5954',
       '18.7669'], 
      dtype='|S114'), 'MAG_AUTO_J': array(['18.0063', '18.7495', '18.1619', ..., '18.9583', '18.1126',
       '17.6575'], 
      dtype='|S114'), 'MAGERR_AUTO_H': array(['0.09775', '0.0828', '0.108675', ..., '0.173075', '0.08165',
       '0.0713'], 
      dtype='|S114'), 'MAG_PETRO_I': array(['17.5898', '19.0811', '19.1917', ..., '19.169', '18.5746', '17.7566'], 
      dtype='|S114'), 'MAG_PETRO_J': array(['18.173', '18.731', '17.9721', ..., '18.764', '17.9934', '17.7978'], 
      dtype='|S114'), 'KCORR_Z_k0': array(['-0.03627668', '-0.03491116', '0.162131', ..., '-0.1188775',
       '-0.01135994', '0.05152805'], 
      dtype='|S114'), 'NMATCHOPT': array(['3', '1', '1', ..., '1', '1', '-999'], 
      dtype='|S114'), 'MAGERR_AUTO_K': array(['0.10925', '0.096025', '0.1081', ..., '569.25', '0.117875',
       '0.058075'], 
      dtype='|S114'), 'B300_k0': array(['0.03514527', '0.04694267', '0.0006007419', ..., '0.1995879',
       '0.02131701', '0.005430317'], 
      dtype='|S114'), 'B300_k1': array(['0.03514527', '0.04694267', '0.0006007419', ..., '0.1995879',
       '0.02131701', '0.005430317'], 
      dtype='|S114'), 'G_MODEL_ERR': array(['0.01578466', '0.02438762', '0.07634434', ..., '0.02904377',
       '0.02699816', '0.01298282'], 
      dtype='|S114'), 'MAG_PETRO_G': array(['18.6482', '19.8579', '20.631', ..., '19.7189', '19.7846', '18.8735'], 
      dtype='|S114'), 'SEX_INDEX_G': array(['0.8809849', '1.183854', '0.04927587', ..., '1.318126', '1.54424',
       '3.076026'], 
      dtype='|S114'), 'SEX_INDEX_K': array(['0.8614245', '1.322982', '0.8500346', ..., '0.2032867', '0.5524842',
       '1.242855'], 
      dtype='|S114'), 'SEX_INDEX_J': array(['0.4110401', '0.5973306', '0.6174935', ..., '0.2173194',
       '0.3790359', '0.823493'], 
      dtype='|S114'), 'SEX_INDEX_I': array(['2.446688', '1.092134', '1.90311', ..., '0.7750819', '1.50512',
       '2.26619'], 
      dtype='|S114'), 'SEX_INDEX_H': array(['0.8034135', '1.378905', '5.298391', ..., '0.582988', '0.7616576',
       '0.804339'], 
      dtype='|S114'), 'BEST_MAGERR_FUV': array(['0.115696', '0.2292213', '0.6004505', ..., '0.06351471',
       '0.2435226', '0.1230028'], 
      dtype='|S114'), 'KCORR_Z_k1': array(['-0.03627668', '-0.03491116', '0.162131', ..., '-0.1188775',
       '-0.01135994', '0.05152805'], 
      dtype='|S114'), 'SEX_INDEX_R': array(['0.6998503', '1.303793', '1.143467', ..., '0.7202741', '1.245958',
       '2.932633'], 
      dtype='|S114'), 'INTSFH_k1': array(['19042190000.0', '5710560000.0', '1.20106e+11', ..., '2904688000.0',
       '12170420000.0', '16256980000.0'], 
      dtype='|S114'), 'INTSFH_k0': array(['19042190000.0', '5710560000.0', '1.20106e+11', ..., '2904688000.0',
       '12170420000.0', '16256980000.0'], 
      dtype='|S114'), 'SEX_INDEX_U': array(['0.4300806', '0.05041962', '-9999.0', ..., '0.05122219',
       '0.1887666', '1.803757'], 
      dtype='|S114'), 'U_MODEL': array(['19.82183', '20.65051', '21.71857', ..., '19.98006', '20.8629',
       '19.90026'], 
      dtype='|S114'), 'SEX_INDEX_Z': array(['0.2626728', '0.9581156', '1.122462', ..., '0.07212458',
       '0.9998073', '2.260492'], 
      dtype='|S114'), 'SEX_INDEX_Y': array(['0.8304486', '0.4309752', '0.962776', ..., '1.216988', '0.5019831',
       '2.190769'], 
      dtype='|S114'), 'KCORR_Y_k0': array(['-0.01122948', '-0.02368502', '0.1926859', ..., '-0.1355442',
       '0.02734818', '0.07121805'], 
      dtype='|S114'), 'KCORR_J_k0': array(['-0.1082048', '-0.09764969', '0.03308818', ..., '-0.1494718',
       '-0.09649172', '-0.01830685'], 
      dtype='|S114'), 'KCORR_J_k1': array(['-0.1082048', '-0.09764969', '0.03308818', ..., '-0.1494718',
       '-0.09649172', '-0.01830685'], 
      dtype='|S114'), 'BEST_MAG_FUV': array(['21.21164', '22.46268', '23.86223', ..., '21.31826', '23.11587',
       '22.3676'], 
      dtype='|S114'), 'KCORR_I_k1': array(['-0.0309916', '-0.1107947', '0.2654688', ..., '-0.107921',
       '0.02357995', '-0.02888804'], 
      dtype='|S114'), 'SPLIT_MAG_NUV': array(['20.4608', '21.656', '22.8951', ..., '21.0673', '22.2386', '-999.0'], 
      dtype='|S114'), 'MAG_AB_NUV': array(['20.465644856', '21.8929750206', '22.9788990557', ...,
       '21.2480168069', '22.2546736162', '22.1289841582'], 
      dtype='|S114'), 'CHI2_k1': array(['5.598145', '0.1679688', '1.043701', ..., '0.295166', '3.781738',
       '0.2382813'], 
      dtype='|S114'), 'CHI2_k0': array(['5.598145', '0.1679688', '1.043701', ..., '0.295166', '3.781738',
       '0.2382813'], 
      dtype='|S114'), 'B1000_k1': array(['0.06461494', '0.2782414', '0.1121969', ..., '0.2876477',
       '0.02977201', '0.2837297'], 
      dtype='|S114'), 'B1000_k0': array(['0.06461494', '0.2782414', '0.1121969', ..., '0.2876477',
       '0.02977201', '0.2837297'], 
      dtype='|S114'), 'GAL_INDEX_K': array(['0.9951', '1.8691', '3.3618', ..., '2.0986', '0.7224', '1.4459'], 
      dtype='|S114'), 'GAL_INDEX_J': array(['0.3686', '1.3386', '2.209', ..., '0.8723', '0.4049', '1.0'], 
      dtype='|S114'), 'GAL_INDEX_I': array(['2.2486', '1.1267', '4.7767', ..., '1.6814', '0.7424', '1.1437'], 
      dtype='|S114'), 'GAL_INDEX_H': array(['1.8635', '1.2674', '11.6587', ..., '2.197', '0.2174', '0.8604'], 
      dtype='|S114'), 'GAL_INDEX_G': array(['0.43', '0.9899', '2.7848', ..., '1.4918', '0.7001', '1.2965'], 
      dtype='|S114'), 'MAG_AUTO_K': array(['17.4309', '18.2133', '17.7895', ..., '99.0', '18.1371', '17.0967'], 
      dtype='|S114'), 'MAG_AUTO_H': array(['17.2557', '18.1516', '17.7984', ..., '18.6458', '17.7131',
       '17.3058'], 
      dtype='|S114'), 'MAG_AUTO_I': array(['17.6367', '19.0449', '19.2198', ..., '19.1679', '18.6201',
       '17.7798'], 
      dtype='|S114'), 'MAG_AUTO_R': array(['18.1078', '19.3259', '19.6823', ..., '19.3053', '18.9893',
       '18.1872'], 
      dtype='|S114'), 'EBV': array(['0.0509', '0.04498', '0.06208', ..., '0.03385', '0.04378', '0.03962'], 
      dtype='|S114'), 'GAL_INDEX_Z': array(['0.5102', '1.0726', '1.874', ..., '0.5339', '1.0624', '0.9777'], 
      dtype='|S114'), 'GAL_INDEX_Y': array(['0.6308', '0.9016', '3.5806', ..., '1.1426', '0.7867', '1.1815'], 
      dtype='|S114'), 'MAG_AUTO_U': array(['19.7518', '20.7133', '21.6596', ..., '20.3018', '20.953', '20.2687'], 
      dtype='|S114'), 'MAG_AUTO_Z': array(['17.6133', '19.0974', '18.5493', ..., '19.4399', '18.3512',
       '17.6213'], 
      dtype='|S114'), 'GAL_INDEX_U': array(['0.1849', '0.6876', '-9999.0', ..., '2.8894', '0.0818', '1.4375'], 
      dtype='|S114'), 'MAG_AUTO_Y': array(['17.6406', '18.8116', '18.812', ..., '18.9775', '18.2698', '17.5228'], 
      dtype='|S114'), 'GAL_INDEX_R': array(['1.7571', '1.133', '4.5774', ..., '1.5675', '0.7992', '1.2691'], 
      dtype='|S114')}

Plot 01: Redshift distribution of our sample


In [5]:
redshift = my_dictionary['Z_HELIO'].astype(float)

In [6]:
sns.boxplot(y=redshift)
plt.show()



In [7]:
sns.boxplot(y=redshift, showfliers=False)
plt.show()


Plot 02: Yi Diagram (NUV - r) x (FUV - NUV) -- ab magnitudes previously corrected


In [8]:
fuv_band = my_dictionary['MAG_AB_FUV'].astype(float)   
nuv_band = my_dictionary['MAG_AB_NUV'].astype(float)
r_band   = my_dictionary['MAG_AB_R'].astype(float)

The following constraint selects UV upturn objects: (nuv_band - r_band) > 5.4) x ((fuv_band - nuv_band) < 0.9) x ((fuv_band - r_band) < 6.6)

The following constraint removes spurious data: (r_band>0) x (nuv_band>0) x (fuv_band>0)


In [9]:
index_uvup = np.where(((nuv_band - r_band) > 5.4) * ((fuv_band - nuv_band) < 0.9) * ((fuv_band - r_band) < 6.6)*(r_band>0)*(nuv_band>0)*(fuv_band>0))
print fuv_band[index_uvup].size


500

In [10]:
plt.plot((nuv_band - r_band), (fuv_band - nuv_band), 'o', color = '#fdae6b', alpha=0.7)
plt.plot((nuv_band - r_band)[index_uvup], (fuv_band - nuv_band)[index_uvup], 'o', color = '#e6550d', alpha=0.7)
plt.axvline(x=5.4, color='black', linewidth=2.)
plt.axhline(y=0.9, color='black', linewidth=2.)
plt.xlabel("NUV-r")
plt.ylabel("FUV-NUV")
plt.xlim(-5, 10)
plt.ylim(-10, 15)
plt.savefig('./Figs/uvupturn.png', dpi=100)
plt.show()



In [11]:
plt.plot((nuv_band - r_band), (fuv_band - nuv_band), 'o', color = '#fdae6b', alpha=0.7)
plt.plot((nuv_band - r_band)[index_uvup], (fuv_band - nuv_band)[index_uvup], 'o', color = '#e6550d', alpha=0.7)
plt.axvline(x=5.4, color='black', linewidth=2.)
plt.axhline(y=0.9, color='black', linewidth=2.)
plt.xlabel("NUV-r")
plt.ylabel("FUV-NUV")
# plt.xlim(-5, 10)
# plt.ylim(-10, 15)
plt.savefig('./Figs/uvupturn_spurious.png', dpi=100)
plt.show()



In [12]:
idx_nospurious = np.where((r_band>0)*(nuv_band>0)*(fuv_band>0)*(fuv_band-nuv_band<50)*((fuv_band-nuv_band)>(-20)))
print r_band[idx_nospurious].size


41968

In [13]:
plt.plot((nuv_band - r_band)[idx_nospurious], (fuv_band - nuv_band)[idx_nospurious], 'o', color = '#fdae6b', alpha=0.7)
plt.plot((nuv_band - r_band)[index_uvup], (fuv_band - nuv_band)[index_uvup], 'o', color = '#e6550d', alpha=0.7)
plt.axvline(x=5.4, color='black', linewidth=2.)
plt.axhline(y=0.9, color='black', linewidth=2.)
plt.xlabel("NUV-r")
plt.ylabel("FUV-NUV")
# plt.xlim(-5, 10)
# plt.ylim(-10, 15)
plt.savefig('./Figs/uvupturn_nospurious.png', dpi=100)
plt.show()


Plot 03: UV upturn objects - histogram of their redshifts


In [14]:
bins = np.arange(0, redshift[idx_nospurious].max(), 0.05)

In [15]:
plt.hist(redshift[idx_nospurious], color='#fdae6b', alpha=0.7, bins=bins, log=True, label='All objects')
plt.hist(redshift[index_uvup], color='#e6550d', alpha=0.7, bins=bins, log=True, label='UV Upturn')
plt.xlabel("Redshift")
plt.ylabel("Frequency")
plt.legend(loc='best', numpoints=1, fontsize=20, frameon=False)
plt.savefig('./Figs/uvupturn_z.png', dpi=100)
plt.show()


IDEA 01: Normalize by amount of galaxies of each bin.


In [16]:
plt.hist(redshift[idx_nospurious], color='#fdae6b', alpha=0.7, bins=bins, normed=True, log=True, label='All objects')
plt.hist(redshift[index_uvup], color='#e6550d', alpha=0.7, bins=bins, normed=True, log=True, label='UV Upturn')
plt.xlabel("Redshift")
plt.ylabel("Frequency")
plt.legend(loc='best', numpoints=1, fontsize=20, frameon=False)
plt.savefig('./Figs/uvupturn_z.png', dpi=100)
plt.show()



In [17]:
sns.kdeplot(redshift[index_uvup], color='#e6550d', shade=False)
sns.kdeplot(redshift, color='#fdae6b', shade=False)
plt.show()



In [18]:
ratio_uvup = []
redshift_uvup = redshift[index_uvup]
for i in range(bins.size):
    if i==0:
        continue
    else:
        index_all    = np.where((bins[i-1] <= redshift[idx_nospurious]) * (redshift[idx_nospurious] <= bins[i]))
        index_uvup_i = np.where((bins[i-1] <= redshift_uvup) * (redshift_uvup <= bins[i]))
        redshift_bin_all  = redshift[index_all]
        redshift_bin_uvup = redshift_uvup[index_uvup_i]
        if (redshift_bin_all.size==0):
            ratio_uvup_i = 0
            print "There are no UV Upturn galaxies in this range of redshift: %.2f and %.2f" % (bins[i-1], bins[i])
        else:
            ratio_uvup_i = (np.float(redshift_bin_uvup.size) / np.float(redshift_bin_all.size)) *100
        ratio_uvup.append(ratio_uvup_i)
ratio_uvup = np.array(ratio_uvup)
print ratio_uvup


There are no UV Upturn galaxies in this range of redshift: 0.85 and 0.90
There are no UV Upturn galaxies in this range of redshift: 0.90 and 0.95
There are no UV Upturn galaxies in this range of redshift: 0.95 and 1.00
There are no UV Upturn galaxies in this range of redshift: 1.00 and 1.05
There are no UV Upturn galaxies in this range of redshift: 1.15 and 1.20
There are no UV Upturn galaxies in this range of redshift: 1.25 and 1.30
There are no UV Upturn galaxies in this range of redshift: 1.30 and 1.35
There are no UV Upturn galaxies in this range of redshift: 1.35 and 1.40
There are no UV Upturn galaxies in this range of redshift: 1.40 and 1.45
There are no UV Upturn galaxies in this range of redshift: 1.45 and 1.50
There are no UV Upturn galaxies in this range of redshift: 1.50 and 1.55
[ 0.26954178  1.61242162  1.64383562  1.28986867  1.07104605  0.72560626
  0.36019811  0.12019231  0.36900369  0.          0.          0.          0.
  0.          0.          0.          0.          0.          0.          0.
  0.          0.          0.          0.          0.          0.          0.
  0.          0.          0.          0.        ]

In [19]:
n_groups = bins.size
index = np.arange(1,n_groups,1)
plt.figure(figsize=(10,5))
plt.bar(index, ratio_uvup, width=1., alpha=0.7, color='#e6550d')
plt.xticks(index, bins)
plt.ylabel("Percentage of UV Upturn Galaxies of the Sample", fontsize=12)
plt.xlabel("Redshift Ranges", fontsize=12)
plt.tick_params('both', labelsize='15')
plt.xlim(0, 16)
plt.savefig('./Figs/percentageuvup.png', dpi=100)
plt.show()



In [20]:
from astropy.cosmology import Planck13

In [21]:
print Planck13.lookback_time(np.percentile(0.6, 75))
print Planck13.lookback_time(np.percentile(0.55, 75))


5.8786654573 Gyr
5.54606951518 Gyr

Plot 04: Absolute Magnitude r band x NUV-r


In [22]:
mag_abs_r = my_dictionary['MAG_ABSOLUTE_R'].astype(float)

In [23]:
plt.plot(mag_abs_r[idx_nospurious], (nuv_band[idx_nospurious]- r_band[idx_nospurious]), 'o', color='gray', alpha=0.05)
plt.plot(mag_abs_r[index_uvup], (nuv_band[index_uvup] - r_band[index_uvup]), 'o', color='#e6550d', alpha=0.2)
sns.kdeplot(mag_abs_r[idx_nospurious], (nuv_band[idx_nospurious] - r_band[idx_nospurious]), n_levels=50, shade=False, 
             cmap="Purples_d", cbar=True)
plt.xlabel("M$_r$", fontsize=15)
plt.ylabel("NUV-r", fontsize=15)
plt.savefig('./Figs/color_mag01.png', dpi=100)
plt.show()



In [24]:
print nuv_band.size
print nuv_band[idx_nospurious].size


43968
41968

Plot 05: Absolute Magnitude r band x g-r


In [25]:
g_band = my_dictionary['MAG_AB_G'].astype(float)

In [26]:
index01 = np.where(((g_band - r_band) <1) * ((nuv_band - r_band) > 5.4) * ((fuv_band - nuv_band) < 0.9) * ((fuv_band - r_band) < 6.6))
plt.plot(mag_abs_r[[(g_band - r_band) <1]], (g_band - r_band)[[(g_band - r_band) < 1]], 'o', color='gray', alpha=0.05)
plt.plot(mag_abs_r[index01], (g_band - r_band)[index01], 'o', color='#e6550d', alpha=0.2)
sns.kdeplot(mag_abs_r[[(g_band - r_band) <1]], (g_band - r_band)[[(g_band - r_band) <1]], n_levels=50, shade=False, cmap="Purples_d", cbar=True)
plt.ylim(-0.5, 1)
plt.xlabel("M$_r$", fontsize=15)
plt.ylabel("g-r", fontsize=15)
plt.savefig('./Figs/color_mag02.png', dpi=100)
plt.show()


Plot 06: Stellar Mass x Redshift


In [27]:
stellar_mass = my_dictionary['MASS_k0'].astype(float)

In [46]:
plt.semilogy(redshift[idx_nospurious], stellar_mass[idx_nospurious], 'o', color='#fdae6b', alpha=0.7, label='All objects')
plt.semilogy(redshift[index_uvup], stellar_mass[index_uvup], 'o', alpha=0.7, color='#e6550d', label='UV Upturn')
plt.xlabel("Redshift", fontsize=15)
plt.ylabel("Stellar Mass", fontsize=15)
plt.legend(loc='best', numpoints=1, fontsize=20, frameon=False)
plt.axhline(y=5E9, color='black', linewidth=1.)
plt.axvline(x=0.35, color='black', linewidth=1.)
plt.savefig('./Figs/mass_z.png')
plt.show()



In [42]:
index_rsf = np.where(((nuv_band - r_band) < 5.4)*(r_band>0)*(nuv_band>0)*(fuv_band>0))
index_uvweak = np.where(((nuv_band - r_band) > 5.4)*((fuv_band - r_band)>6.6)*(r_band>0)*(nuv_band>0)*(fuv_band>0))
print fuv_band[index_rsf].size, fuv_band[index_uvweak].size


39864 2190

In [45]:
# plt.semilogy(redshift[idx_nospurious], stellar_mass[idx_nospurious], 'o', color='#fdae6b', alpha=0.7, label='All objects')
plt.semilogy(redshift[index_rsf], stellar_mass[index_rsf], 'o', alpha=0.7, color='#8da0cb', label='RSF')
plt.semilogy(redshift[index_uvweak], stellar_mass[index_uvweak], 'o', alpha=0.7, color='#66c2a5', label='UV Weak')
plt.semilogy(redshift[index_uvup], stellar_mass[index_uvup], 'o', alpha=0.7, color='#fc8d62', label='UV Upturn')
plt.xlabel("Redshift", fontsize=15)
plt.ylabel("Stellar Mass", fontsize=15)
plt.legend(loc='best', numpoints=1, fontsize=20, frameon=False)
plt.axhline(y=5E9, color='black', linewidth=1.)
plt.axvline(x=0.35, color='black', linewidth=1.)
plt.savefig('./Figs/mass_z_uvcategories.png')
plt.show()


Plot 07: Absolute Magnitude r band x Redshift


In [31]:
plt.plot(redshift[idx_nospurious], mag_abs_r[idx_nospurious], 'o', color='#fdae6b', alpha=0.7, label='All objects')
plt.plot(redshift[index_uvup], mag_abs_r[index_uvup], 'o', color='#e6550d', alpha=0.7, label='UV Upturn')
plt.xlabel("Redshift", fontsize=15)
plt.ylabel("M$_{r}$", fontsize=15)
plt.legend(loc='best', numpoints=1, fontsize=20, frameon=False)
plt.savefig('./Figs/mag_redshift.png', dpi=100)
plt.show()



In [32]:
plt.hexbin(redshift[idx_nospurious], mag_abs_r[idx_nospurious], gridsize=100, bins='log', label='All objects')
plt.xlabel("Redshift", fontsize=15)
plt.ylabel("M$_{r}$", fontsize=15)
plt.legend(loc=4, numpoints=1, fontsize=20, frameon=False)
plt.savefig('./Figs/mag_redshift_hexbin.png', dpi=100)
plt.show()



In [33]:
plt.hexbin(redshift[index_uvup], mag_abs_r[index_uvup], gridsize=20, bins='log', label='UV Upturn')
plt.xlabel("Redshift", fontsize=15)
plt.ylabel("M$_{r}$", fontsize=15)
plt.legend(loc=4, fontsize=20, frameon=False)
plt.savefig('./Figs/mag_redshift_uv_hexbin.png', dpi=100)
plt.show()


Plot 07: Some distributions


In [34]:
plt.hist((g_band - r_band)[idx_nospurious], bins=np.arange((g_band - r_band)[idx_nospurious].min(), (g_band - r_band)[idx_nospurious].max(), 0.15), color='#e6550d', 
         log=True)
plt.xlabel("g-r", fontsize=15)
plt.ylabel("Frequency", fontsize=15)
plt.tick_params('both', labelsize=15)
plt.show()



In [35]:
plt.hist((fuv_band - nuv_band)[idx_nospurious], bins=np.arange((g_band - r_band)[idx_nospurious].min(), (fuv_band - nuv_band)[idx_nospurious].max(), 0.5), color='#e6550d', 
         log=True)
plt.xlabel("FUV-NUV", fontsize=15)
plt.ylabel("Frequency", fontsize=15)
plt.tick_params('both', labelsize=15)
plt.show()


Plot 07: heatmap


In [36]:
my_dataframe = pd.read_csv('myGAMA_ALL_AB_ABSOL_MAGS.csv')
my_dataframe = pd.DataFrame(my_dataframe)
my_dataframe = my_dataframe.drop(['CATAID'], axis=1)

In [37]:
my_dataframe = my_dataframe.fillna(-999)

In [38]:
my_data_10 = my_data[:, 0:10].astype(str)
print my_data_10.shape


(43969, 10)

In [39]:
my_data_10 = pd.DataFrame(my_data_10).fillna(-999)
my_data_10 = my_data_10.dropna

In [40]:
lambda_displaced_fuv = 1530 * (1.+0.4)
print lambda_displaced_fuv


2142.0